package se.webbzon.boltzmann.battle.factory.property;

import se.webbzon.boltzmann.battle.environment.BattleEnvironment;
import se.webbzon.boltzmann.battle.property.BattleProperty;
import se.webbzon.boltzmann.battle.property.BattlePropertyFactory;
import se.webbzon.boltzmann.battle.strategy.playerstrategy.PlayerStrategy;
import se.webbzon.boltzmann.player.Player;
import se.webbzon.boltzmann.player.PlayerEnergy;
import se.webbzon.boltzmann.player.PlayerHealth;

public class PlayerBPF extends BattlePropertyFactory {
	
	// The battle environment in which the battle property should be created
	private final BattleEnvironment benv;
	
	// The player associated with this battle property factory
	private final Player player;

	/*============================================================
	Constructor
	============================================================*/
	
	public PlayerBPF(BattleEnvironment benv, Player player) {
		super("Player");
		this.benv = benv;
		this.player = player;
	}
	
	/*============================================================
	Public Methods
	============================================================*/

	@Override public BattleProperty makeNew(Object body) {
		PlayerStrategy strategy = new PlayerStrategy(benv,player);
		
		final PlayerHealth health = player.getHealth();
		final PlayerEnergy energy = player.getEnergy();
		return new BattleProperty(	player.getCharacter().getCharacterTextureSetName(),
									health.getMaxHealth(),health.getHealth(),
									energy.getMaxEnergy(),energy.getEnergy(),
									strategy);
	}

}
